package me.zhengjie.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum RedisKeyEnum {

    Course("course:","课程",0) ,
    User("user:","用户",0),
    Order("order:","订单",0),
    Group("group:","团队",0),
    ClassCourseNo("class:on:","班级",0),
    ClassClassNo("class:ln:","班级",0),
    Enterprise("enterprise:","企业编码",60*60*24*7),
    SignIn("signin:","签到",3)
    ;
    private String key;
    private String desc;
    private long expire;


    public static String getCourseInfoKey(String courseNo) {

        return Course.getKey() + courseNo;
    }
    public static String getClassInfoCourseNoKey(String courseNo) {

        return ClassCourseNo.getKey() + courseNo;
    }

    public static String getClassInfoClassNoKey(String classNo) {

        return ClassClassNo.getKey() + classNo;
    }

    public static String getEnterpriseKey(String enterpriseNo) {
        return Enterprise.getKey() + enterpriseNo;
    }
}
